package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbAddressMapper;
import com.dongdongshop.pojo.TbAddress;
import com.dongdongshop.pojo.TbAddressExample;
import com.dongdongshop.pojo.VoAddress;
import com.dongdongshop.service.TbAddressServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class TbAddressServiceImpl implements TbAddressServiceI {

    @Autowired
    private TbAddressMapper tbAddressMapper;

    @Override
    public List<VoAddress> getAddress() {
        return tbAddressMapper.getAddress();
    }

    @Override
    public void addTbAddress(TbAddress tbAddress) {
        tbAddressMapper.insertSelective(tbAddress);
    }

    @Override
    public void deleteAddress(Long id) {
        tbAddressMapper.deleteByPrimaryKey(id);
    }

    @Override
    public TbAddress selectTbAddressesById(Long id) {
        return tbAddressMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updateAddress(TbAddress tbAddresses) {
        tbAddressMapper.updateByPrimaryKeySelective(tbAddresses);
    }

    @Override
    public List<VoAddress> getAddresss(String username) {

        return tbAddressMapper.getAddresss(username);
    }

    @Override
    public VoAddress selectInfoAddressById(Long id) {

        return tbAddressMapper.selectInfoAddressById(id);
    }
}
